<div class="refentry"><a id="glGetError"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>glGetError — return error information</p></div><div class="refsynopsisdiv"><h2>C Specification</h2><div class="funcsynopsis"><table class="funcprototype-table" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">GLenum <strong class="fsfunc">glGetError</strong>(</code></td><td> <var class="pdparam">void</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div></div><div class="refsect1"><a id="description"></a><h2>Description</h2><p>
            <code class="function">glGetError</code> returns the value of the error flag.
            Each detectable error is assigned a numeric code and symbolic name.
            When an error occurs,
            the error flag is set to the appropriate error code value.
            No other errors are recorded until <code class="function">glGetError</code> is called,
            the error code is returned,
            and the flag is reset to <code class="constant">GL_NO_ERROR</code>.
            If a call to <code class="function">glGetError</code> returns <code class="constant">GL_NO_ERROR</code>,
            there has been no detectable error since the last call to <code class="function">glGetError</code>,
            or since the GL was initialized.
        </p><p>
            To allow for distributed implementations,
            there may be several error flags.
            If any single error flag has recorded an error,
            the value of that flag is returned
            and that flag is reset to <code class="constant">GL_NO_ERROR</code>
            when <code class="function">glGetError</code> is called.
            If more than one flag has recorded an error,
            <code class="function">glGetError</code> returns and clears an arbitrary error flag value.
            Thus, <code class="function">glGetError</code> should always be called in a loop,
            until it returns <code class="constant">GL_NO_ERROR</code>,
            if all error flags are to be reset.
        </p><p>
            Initially, all error flags are set to <code class="constant">GL_NO_ERROR</code>.
        </p><p>
            The following errors are currently defined:
        </p><div class="variablelist"><dl class="variablelist"><dt><span class="term"><code class="constant">GL_NO_ERROR</code></span></dt><dd><p>
                        No error has been recorded.
                        The value of this symbolic constant is guaranteed to be 0.
                    </p></dd><dt><span class="term"><code class="constant">GL_INVALID_ENUM</code></span></dt><dd><p>
                        An unacceptable value is specified for an enumerated argument.
                        The offending command is ignored
                        and has no other side effect than to set the error flag.
                    </p></dd><dt><span class="term"><code class="constant">GL_INVALID_VALUE</code></span></dt><dd><p>
                        A numeric argument is out of range.
                        The offending command is ignored
                        and has no other side effect than to set the error flag.
                    </p></dd><dt><span class="term"><code class="constant">GL_INVALID_OPERATION</code></span></dt><dd><p>
                        The specified operation is not allowed in the current state.
                        The offending command is ignored
                        and has no other side effect than to set the error flag.
                    </p></dd><dt><span class="term"><code class="constant">GL_INVALID_FRAMEBUFFER_OPERATION</code></span></dt><dd><p>
                        The command is trying to render to or read from the framebuffer
                        while the currently bound framebuffer is not framebuffer
                        complete (i.e. the return value from
                        <a class="citerefentry" href="glCheckFramebufferStatus"><span class="citerefentry"><span class="refentrytitle">glCheckFramebufferStatus</span></span></a>
                        is not <code class="constant">GL_FRAMEBUFFER_COMPLETE</code>).
                        The offending command is ignored
                        and has no other side effect than to set the error flag.
                    </p></dd><dt><span class="term"><code class="constant">GL_OUT_OF_MEMORY</code></span></dt><dd><p>
                        There is not enough memory left to execute the command.
                        The state of the GL is undefined,
                        except for the state of the error flags,
                        after this error is recorded.
                    </p></dd></dl></div><p>
            When an error flag is set,
            results of a GL operation are undefined only if <code class="constant">GL_OUT_OF_MEMORY</code>
            has occurred.
            In all other cases,
            the command generating the error is ignored and has no effect on the GL state
            or frame buffer contents.
            If the generating command returns a value, it returns 0.
        </p></div>
        {$pipelinestall}{$examples}
        <div class="refsect1"><a id="seealso"></a><h2>See Also</h2><p>
            <a class="citerefentry" href="glCheckFramebufferStatus"><span class="citerefentry"><span class="refentrytitle">glCheckFramebufferStatus</span></span></a>
        </p></div><div class="refsect1"><div id="Copyright"><h2>Copyright</h2><p>
            Copyright © 1991-2006
            Silicon Graphics, Inc. This document is licensed under the SGI
            Free Software B License. For details, see
            <a class="ulink" href="https://web.archive.org/web/20171022161616/http://oss.sgi.com/projects/FreeB/" target="_top">https://web.archive.org/web/20171022161616/http://oss.sgi.com/projects/FreeB/</a>.
        </p></div></div></div>
